<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8"/>
<title>异步加载</title>
<script type="text/javascript">
function initialize() {
  var mp = new BMap.Map('map');
  mp.centerAndZoom(new BMap.Point(<?php echo $longitude;?>, <?php echo $latitude;?>), 11);
}
 
function loadScript() {
  var script = document.createElement("script");
  script.src = "http://api.map.baidu.com/api?v=1.5&ak=865262b033e470fa2d57a75ed533bb03&callback=initialize";//此为v1.5版本的引用方式
  // http://api.map.baidu.com/api?v=1.5&ak=您的密钥&callback=initialize"; //此为v1.4版本及以前版本的引用方式
  document.body.appendChild(script);
}
 
window.onload = loadScript;
</script>
</head>
<body>
  <div id="map" style="width:500px;height:320px"></div>
</body>
</html>